
/* 变量 */
var thirdUrl = "common/thirdUrl.html";
/* 第三方连接  */
var contactsCallback_thirdUrl = myApp.onPageInit('thirdUrl', function (page) {
    //获取页面参数
    var url = ISS.utils.getParameter("url");
    if (page != undefined) {
        url = page.query.url;
    }

    if (url == undefined || url == null || url == "") return;

    if (!(is_weixin() && (url.indexOf("tmall") > -1 || url.indexOf("taobao") > -1))) {
        window.location.href = decodeURIComponent(url);
    }
});

function is_weixin() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
        return true;
    } else {
        return false;
    }
}

/* 初始化  */
function initData() {
    var href = window.location.href;
    if (href.indexOf(thirdUrl) > -1) {
        contactsCallback_thirdUrl.trigger();
    }
}

initData();